#include "CApp.h"
 
void CApp::OnLoop() {
	//SDL_Delay(5);
	Anim_Yoshi.OnAnimate();

	CFPS::FPSControl.OnLoop();
	for(int i = 0;i < (int)CEntity::EntityList.size();i++) {
		if(!CEntity::EntityList[i]) continue;
 
		CEntity::EntityList[i]->OnLoop();
	}

	//Collision Events
	for(int i = 0;i < (int)CEntityCol::EntityColList.size();i++) {
		CEntity* EntityA = CEntityCol::EntityColList[i].EntityA;
		CEntity* EntityB = CEntityCol::EntityColList[i].EntityB;
 
		if(EntityA == NULL || EntityB == NULL) continue;
 
		if(EntityA->OnCollision(EntityB)) {
			EntityB->OnCollision(EntityA);
		}
	}
 
CEntityCol::EntityColList.clear();
}